#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <memory>

using namespace std;

void foo(int* p)
{
	std::cout << *p << std::endl;
}

int main()
{
	auto i = 42;
	auto l = 42LL;
	auto a = "1";

	cout << sizeof(a) << endl;

	std::map<std::string, std::vector<int>> map;
	std::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	map["one"] = v;

	for (const auto& kvp : map)
	{
		std::cout << kvp.first << std::endl;

		for (auto v : kvp.second)
		{
			std::cout << "  " << v << std::endl;
		}
	}

	int arr[] = { 1,2,3,4,5 };
	for (int& e : arr)
	{
		e = e*e;
		cout << e << endl;
	}


	std::unique_ptr<int> p1(new int(42));
	std::unique_ptr<int> p2 = std::move(p1); // transfer ownership

	if (p1)
		foo(p1.get());

	(*p2)++;

	if (p2)
		foo(p2.get());

	return 0;
}
class B
{
public:
	virtual void f(int) { std::cout << "B::f" << std::endl; }
};

class D : public B
{
public:
	virtual void f(int) override { std::cout << "D::f" << std::endl; }
};